package cn.yj.wx.pay.enrity;

import java.util.StringJoiner;

/**
 * @author 永健
 * @since 2021-09-23 10:34
 */
public class JSAPIPayOrderResult extends PayOrderResult {
    /**
     * 调起支付关键信息
     */
    private Payment payment;

    public Payment getPayment() {
        return payment;
    }

    public JSAPIPayOrderResult setPayment(Payment payment) {
        this.payment = payment;
        return this;
    }

    public static class Payment {
        private String appId;
        private String timeStamp;
        private String nonceStr;
        private String packageStr;
        private String signType = "RSA";
        private String paySign;

        public String getAppId() {
            return appId;
        }

        public Payment setAppId(String appId) {
            this.appId = appId;
            return this;
        }

        public String getTimeStamp() {
            return timeStamp;
        }

        public Payment setTimeStamp(String timeStamp) {
            this.timeStamp = timeStamp;
            return this;
        }

        public String getNonceStr() {
            return nonceStr;
        }

        public Payment setNonceStr(String nonceStr) {
            this.nonceStr = nonceStr;
            return this;
        }

        public String getPackageStr() {
            return packageStr;
        }

        public Payment setPackageStr(String packageStr) {
            this.packageStr = packageStr;
            return this;
        }

        public String getSignType() {
            return signType;
        }


        public String getPaySign() {
            return paySign;
        }

        public Payment setPaySign(String paySign) {
            this.paySign = paySign;
            return this;
        }

        @Override
        public String toString() {
            return new StringJoiner(", ", Payment.class.getSimpleName() + "[", "]").add("appId='" + appId + "'").add(
                    "timeStamp='" + timeStamp + "'").add("nonceStr='" + nonceStr + "'").add("packageStr='" + packageStr + "'").add("signType='" + signType + "'").add("paySign='" + paySign + "'").toString();
        }
    }
}
